import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)

#string
r.set('foo', 'bar')
r.get('foo')
#abc = r.get('foo1')
#print abc 

#queue
for i in range(0, 10):
    r.lpush('spider.todo', i)

for i in range(0, 10):
    print r.rpop('spider.todo')

#hash
r.hmset('student', {'name':'abc', 'age':20, 'sex':'female'})
print r.hvals('student')
print r.hgetall('student')
